package com.qiaofang.applet.service.member.repository;

import com.qiaofang.applet.service.member.domain.MemberFocus;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.repository.DeleteQuery;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author daiyuxiang
 */
@Repository
public interface MemberFocusRepository extends MongoRepository<MemberFocus, String> {

    @DeleteQuery("{ 'memberId': '?0', 'businessUuid': '?1', 'businessType': '?2' }")
    int deleteByMemberIdAndBusinessUuidAndBusinessType(String memberId, String businessUuid, String businessType);

    List<MemberFocus> findAllByCorporationCodeAndMemberIdAndBusinessType(String corporationCode, String memberId, String businessType);
}
